package Clock;

import java.sql.Time;
import java.util.Calendar;

public abstract class Clock 
{
	  protected int seconds;
	  protected String str;
	  protected int random;
	  
	  protected long CalTimeBefor;
	  
	  public String toString()
	  {
		return str + "0"+ seconds/60 +":"+((seconds%60>=10)?seconds%60:"0"+seconds%60);
	  }
	  public void updateSeconds()
	  {
		  Calendar clock1 = Calendar.getInstance();  
	      long time1 = clock1.getTimeInMillis(); 
	      if(Math.abs(CalTimeBefor-time1)>=1000)
	      {
	    	  seconds--;
	    	  CalTimeBefor = time1;
	      }  
	  }
	  
		public int GetSeconds()
		{
			return seconds;
		}
		public int Getrandom()
		{
			return random;
		}

}
